package org.tloss.web.editor.model;

import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.tloss.web.editor.database.editors.jdbc.Schema;
import org.tloss.web.editor.database.editors.jdbc.Table;

@XmlRootElement(name = "database")
public class Database {
	String jdbcURL;
	String jdbcUsername;
	String jdbcPassword;
	String driverClass;
	String jdbcLib;
	Schema schema;
	List<Table> tables;
	Boolean offineModde = false;

	@XmlAttribute
	public Boolean getOffineModde() {
		return offineModde;
	}

	public void setOffineModde(Boolean offineModde) {
		this.offineModde = offineModde;
	}

	public void setTables(List<Table> tables) {
		this.tables = tables;
	}

	@XmlElementWrapper(name = "tables")
	@XmlElement(name = "table")
	public List<Table> getTables() {
		return tables;
	}

	@XmlElement
	public Schema getSchema() {
		return schema;
	}

	public void setSchema(Schema schema) {
		this.schema = schema;
	}

	@XmlElement
	public String getJdbcURL() {
		return jdbcURL;
	}

	public void setJdbcURL(String jdbcURL) {
		this.jdbcURL = jdbcURL;
	}

	@XmlElement
	public String getJdbcUsername() {
		return jdbcUsername;
	}

	public void setJdbcUsername(String jdbcUsername) {
		this.jdbcUsername = jdbcUsername;
	}

	@XmlElement
	public String getJdbcPassword() {
		return jdbcPassword;
	}

	public void setJdbcPassword(String jdbcPassword) {
		this.jdbcPassword = jdbcPassword;
	}

	@XmlElement
	public String getDriverClass() {
		return driverClass;
	}

	public void setDriverClass(String driverClass) {
		this.driverClass = driverClass;
	}

	@XmlElement
	public String getJdbcLib() {
		return jdbcLib;
	}

	public void setJdbcLib(String jdbcLib) {
		this.jdbcLib = jdbcLib;
	}

}
